﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using RRTWSEntityDSD.Dominio;
using RRTWSEntityDSD.Dao;

namespace RRTWSDSD.ServiceEntidad
{
    /// <summary>
    /// Summary description for EstadioService
    /// </summary>
    [WebService(Namespace = "http://rtt.edu.upc.com.pe/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class EstadioService : System.Web.Services.WebService
    {
        private static EstadioDAO estadioDAO = new EstadioDAO();

        [WebMethod]
        public Estadio crearEstadio(string nombre, int idubigeo)
        {
            return estadioDAO.insert(nombre, idubigeo);
        }
        [WebMethod]
        public Estadio modificarEstadio(int idequipo, string nombre, int idubigeo)
        {
            return estadioDAO.update(idequipo, nombre, idubigeo);
        }
        [WebMethod]
        public List<Estadio> listarEstadioPorUbigeo(string codigUbigeo)
        {
            return estadioDAO.getListarEstadioPorUbigeo(codigUbigeo);
        }
        [WebMethod]
        public List<Estadio> getlistarEstadios()
        {
            return estadioDAO.ListarTodos().ToList();
        }
        [WebMethod]
        public Estadio getEstadio(int id)
        {
            return estadioDAO.getEstadio(id);
        }
    }
}
